package com.utils;

import org.springframework.beans.BeanUtils;

/**
 * @author c-fanqj
 * @date 2022/8/23
 * @apiNote
 */
public class BeanUtil extends BeanUtils {

    public static <T> T objects2obj(Object from, Class<T> clazz) {
        try {
            T t = clazz.newInstance();
            copyProperties(from, t);
            return t;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
